package Problem;

import java.util.Random;
import java.util.Scanner;

import Problem.*;

public class 去重排序 {
	
	public static void main(String arg[]) {
		Scanner scan = new Scanner(System.in);
		int num = scan.nextInt();
		int[] arr = new int[num];
		for (int i = 0; i < num; i++) {
			arr[i] = scan.nextInt();
		}
		int temp;
		boolean flag = true;
		for (int i = 0; i < arr.length; i++) {
			if(arr[i] != 0) {
				for (int j = i+1; j < arr.length; j++) {
					if(arr[j] != 0) {
						if(arr[i] > arr[j]) {
							temp = arr[i];
							arr[i] = arr[j];
							arr[j] = temp;
						}else if(arr[i] == arr[j]) {
							arr[j] = 0;
							num--;
						}
					}
				}
			}
		}
		System.out.println(num);
		for (int i = 0; i < arr.length; i++) {
			if(arr[i] != 0) {
				System.out.print(arr[i] + " ");
			}
		}
	}

}
